package com.hzw.saas.common.security.enums;

/**
 *
 * @Description
 * @Date 2021/8/5 5:54 下午
 * @Created by sonam
 */
public enum UserType {
    ADMIN(0, "系统用户"),
    SAAS_USER(1, "SAAS云平台用户"),
    ;
    /**
     * 状态代号
     */
    private final int code;

    /**
     * 状态文本
     */
    private final String text;

    UserType(int code, String text) {
        this.code = code;
        this.text = text;
    }

    public int code() {
        return code;
    }

    public String text() {
        return text;
    }

    public static UserType instance(int code) {
        for (UserType value : values()) {
            if (value.code() == code) {
                return value;
            }
        }
        return null;
    }
}
